﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>  
<head>  
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<SCRIPT language=JavaScript>  
$("document").ready(function(){  
    //第六个表格的删除按钮事件绑定   
    $("#tbody6 .del").click(function() {   
        $(this).parents(".repeat").remove();   
    });   
    //第六个表格的添加按钮事件绑定   
    $("#add6").click(function(){   
        $("#tbody6>.template")   
            //连同事件一起复制   
            .clone(true)   
            //去除模板标记   
            .removeClass("template")   
            //修改内部元素   
            .find(".content")   
                .text("新增行")   
                .end()  
           .find(".del")   
                .text("删除")   
                .end()        
            //插入表格   
            .appendTo($("#tbody6"))   
    });   
})
function subTest()
{
  setRadio('QuestionType','single_other')
}  

function setRadio(name,aValue){    //传入对象name
   var radio_name = document.getElementsByName(name)
   for(var i=0;i<radio_name.length;i++) //循环
   {
      if(radio_name[i].value==aValue) //比较值
      { 
        radio_name[i].checked=true; //修改选中状态
        break; //停止循环
      }
    }
}
</script>  
</head>  
<body>  
<a href="#" onclick="subTest()">test</a>
<div style="padding: 0 10px 0 10px">
                问题类型:&nbsp;
                &nbsp;<input type="radio" name="QuestionType" class="QuestionType" value="single" checked  />单选
                &nbsp;<input type="radio" name="QuestionType" class="QuestionType" value="single_other"/>单选(带自填)
                &nbsp;<input type="radio" class="QuestionType" name="QuestionType" value="multicheck" />多选
                &nbsp;<input type="radio" class="QuestionType" name="QuestionType" value="multicheck_other" />多选(带自填)
                &nbsp;<input type="radio" class="QuestionType" name="QuestionType" value="singleblank" />问答
</div>
<ul  id="tbody6">   
    <li class="template repeat">   
        <span class="content">这里是模板</span>   
        <span><button class="del">删除</button></span>   
    </li>   
    <li class="repeat">   
        <span class="content">这行原来就有</span>   
        <span><button class="del">删除</button></span>   
    </li>   
    <li class="repeat">   
        <span class="content">这行原来就有</span>   
        <span><button class="del">删除</button></span>   
    </li>   
</ul>   
   
      <button id="add6">添加</button>  
      
</body>  
</html>